INIT_WITH_DB
INIT_WITH_DB = 1
Base class of the Roundcube Framework implemented as singleton
$config : \rcube_config
$db : \rcube_db
$session : \rcube_session
$smtp : \rcube_smtp
$storage : \rcube_storage
$output : \rcube_output
$plugins : \rcube_plugin_api
$user : \rcube_user
$request_status : int
$texts : array
$caches : \rcube_cache[]
$shutdown_functions : array
$instance : \rcube
get_instance(int $mode, string $env = '') : \rcube
This implements the 'singleton' design pattern
int | $mode | Options to initialize with this instance. See rcube::INIT_WITH_* constants |
string | $env | Environment name to run (e.g. live, dev, test) |
The one and only instance
get_cache(string $name, string $type = 'db', string $ttl, bool $packed = true, bool $indexed = false) : \rcube_cache|null
Initialize and get user cache object
string | $name | Cache identifier |
string | $type | Cache type ('db', 'apc', 'memcache', 'redis') |
string | $ttl | Expiration time for cache items |
bool | $packed | Enables/disables data serialization |
bool | $indexed | Use indexed cache |
User cache object
text_exists(string $name, string $domain = null, string $ref_domain = null) : bool
Check if the given text label exists
string | $name | Label name |
string | $domain | Label domain (plugin) name or '*' for all domains |
string | $ref_domain | Sets domain name if label is found |
True if text exists (either in the current language or in en_US)
read_localization(string $dir, string|null $lang = null) : array
Read localized texts from an additional location (plugins, skins).
Then you can use the result as 2nd arg to load_language().
string | $dir | Directory to search in |
string|null | $lang | Language code to read |
Localization labels/messages
encrypt(string $clear, string $key = 'des_key', bool $base64 = true) : string|false
Encrypt a string
string | $clear | Clear text input |
string | $key | Encryption key to retrieve from the configuration, defaults to 'des_key' |
bool | $base64 | Whether or not to base64_encode() the result before returning |
Encrypted text, false on error
decrypt(string $cipher, string $key = 'des_key', bool $base64 = true) : string|false
Decrypt a string
string | $cipher | Encrypted text |
string | $key | Encryption key to retrieve from the configuration, defaults to 'des_key' |
bool | $base64 | Whether or not input is base64-encoded |
Decrypted text, false on error
Q(string $str, string $mode = 'strict', bool $newlines = true) : string
Quote a given string.
Shortcut function for rcube_utils::rep_specialchars_output()
string | $str | A string to quote |
string | $mode | Replace mode for tags: show|remove|strict |
bool | $newlines | Convert newlines |
HTML-quoted string
raise_error(array $arg = [], bool $log = false, bool $terminate = false) : mixed
Throw system error (and show error page).
array | $arg | Named parameters
|
bool | $log | True to log the error |
bool | $terminate | Terminate script execution |
deliver_message(\Mail_Mime $message, string $from, array|string $mailto, array|string $error, string $body_file = null, array $options = null, bool $disconnect = false) : bool
Send the given message using the configured method.
\Mail_Mime | $message | Reference to Mail_MIME object |
string | $from | Sender address string |
array|string | $mailto | Either a comma-separated list of recipients (RFC822 compliant), or an array of recipients, each RFC822 valid |
array|string | $error | SMTP error array or (deprecated) string |
string | $body_file | Location of file with saved message body, used when delay_file_io is enabled |
array | $options | SMTP options (e.g. DSN request) |
bool | $disconnect | Close SMTP connection ASAP |
Send status.